Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOM の章の確認問題を追加、内容のアップデート #725

Merged
merged 9 commits into from
May 14, 2024

Conversation

naka-12
Copy link
Contributor

@naka-12 naka-12 commented Apr 30, 2024

  • textContent の操作、style の操作、要素の作成と追加の 3 ステップにそれぞれ確認問題を追加しました。5d40b1c
    • →要素の作成と追加については削除しました。
  • HTML の雛形を冒頭で提示しました。前章では CSS を扱っているため、JavaScript を読み込んでいる雛形を得るにはかなり戻ってコピペしなければならないためです。be28997
  • HTML を省略するという旨、script 要素は body 要素の末尾に置かなければならない旨を明示しました。これらは「HTML」「JavaScript」の章でそれぞれ触れてはいるものの、それらの章の中ではほぼ問題にならないため、「DOM」で初めて問題に直面する人が多く戸惑いの原因になっているためです。
    • すみませんこれ 5d40b1c に混ぜてしまいました……
  • 変数名を element から greetingElement に修正しました。bc2fad5

@naka-12 naka-12 requested review from chvmvd and aster-void April 30, 2024 20:12
Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認問題は本当に説明したことをそのまま写せばできるぐらいの難易度で、演習問題は理解していたら解けるぐらいの難易度にすると良いかと思います。

docs/1-trial-session/13-dom/index.mdx Outdated Show resolved Hide resolved
docs/1-trial-session/13-dom/index.mdx Outdated Show resolved Hide resolved
docs/1-trial-session/13-dom/index.mdx Outdated Show resolved Hide resolved
docs/1-trial-session/13-dom/index.mdx Outdated Show resolved Hide resolved
docs/1-trial-session/13-dom/index.mdx Show resolved Hide resolved
Copy link

cloudflare-workers-and-pages bot commented May 9, 2024

Deploying utcode-learn with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7fa8024
Status: ✅  Deploy successful!
Preview URL: https://25aa687d.utcode-learn.pages.dev
Branch Preview URL: https://update-dom-description.utcode-learn.pages.dev

View logs

@naka-12 naka-12 requested a review from chvmvd May 9, 2024 11:37
下のような HTML が記述されています。

```html title="index.html"
<div>Good <strong id="greeting-type">morning</strong>!</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ greeting-type で英語的に合ってるんでしょうか?
greeting-time とかの方が良さそうに見えます。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://learn.utcode.net/docs/trial-session/functions/#引数
に倣いましたが、確かにそうですね……

Copy link
Contributor

@chvmvd chvmvd May 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

greeting-typeだと有限のものの1つで、greeting-timeだと無限のもの(連続のもの)の1つという感覚を受けそうですね。
今回だとmorningafternooneveningみたいな感じで有限なもののどれかということを表しているので、greetingTypeだと明確かなと思いました。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そしたらとりあえずこのままにします。問題があれば後で両方変えましょう

<div id="greeting"></div>
```

JavaScript を使って、太字で `Hello World!` と表示されるようにしてください。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「太字で」だけだと style を書き換えるように聞こえるので、ヒントで説明を加えると良さそうです 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

まあ strong を使いましょうって普通に言っちゃいますか。

@naka-12 naka-12 requested review from chvmvd and aster-void May 13, 2024 06:20
@naka-12 naka-12 force-pushed the update-dom-description branch from 25993d9 to 5b75848 Compare May 13, 2024 06:51
Copy link
Contributor

@aster-void aster-void left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他は良いと思います!

@@ -62,8 +119,8 @@ element.style.backgroundColor = "red";
中身のない空の要素が作成されるので、`textContent` を `おやつ` に設定してみましょう。

```js title="script.js"
const newItem = document.createElement("li");
newItem.textContent = "おやつ";
const snackItem = document.createElement("li");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snackとitemは重複してる気がする?

Copy link
Contributor

@chvmvd chvmvd May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snackElementならHTML要素だという意味がelementに込められるからまだありだとは思うけど、snackItemだとitemとつけても情報量がそこまでは変わらない気がする。ある程度の効果はわからないでもないけど。

@naka-12 naka-12 requested review from chvmvd and aster-void May 13, 2024 12:31
Copy link
Contributor

@chvmvd chvmvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

良いと思います。

@naka-12 naka-12 merged commit a1e7add into master May 14, 2024
3 checks passed
@naka-12 naka-12 deleted the update-dom-description branch May 14, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants